<!DOCTYPE html>
<html class="wh100">
	<head>
		<meta charset="UTF-8"> 
		<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
		<title>{:C('WEB_SITE_TITLE')}</title>
		<link rel="stylesheet" href="__PUBLIC__/Home/css/common.css">
		<link rel="stylesheet" href="__PUBLIC__/Home/css/main.css" />
		<script src="__PUBLIC__/Home/js/zepto.js"></script>
		<script src="__PUBLIC__/Home/js/common.js"></script>
		<script src="__PUBLIC__/Home/js/delIOS_huitan.js"></script>
	</head>
	<body class="wh100 box">
		<!--提示文字-->
		<div class="tip" style="opacity: 0;z-index: -1"></div>
		<!--正文区域-->
		<div id="findPwdMain" class="lzMain zmMain maxWidth fastscroll">
			<div class="topBar">
				<a class="hz back" href="javascript:;">&#xe600;</a>
				密码找回
			</div>
			<div class="middle">
				<div class="key inputArea">
					<span>新密码</span><input type="password" placeholder="请输入新密码" name="login_pass" id="login_pass"/>
				</div>
				<div class="ckeckkey inputArea">
					<span>确认新密码</span><input type="password" placeholder="请再次输入新密码" id="repassword" name="repassword"/>
				</div>
				<a href="javascript:;" class="submitbtn">确认</a>
			</div>
		</div>

		<script>
			//返回按钮
			$('#findPwdMain .back').on('tap',function(){
				window.history.go(-1);
			});

			//tip
			function tipFun(str){
				$('.tip').text(str).css({
					'opacity':'1',
					'z-index':'9999'
				});
				setTimeout(function(){
					$('.tip').css('opacity','0');
					setTimeout(function(){
						$('.tip').css('z-index','-1');
					},300);
				},1300);
			}

			//点击确认
			$('#findPwdMain .middle .submitbtn').on('tap',function(){
//				console.log('确认');

				var pwd1=$('#login_pass').val();
				var pwd2=$('#repassword').val();
				if(!notEmpty(pwd1)){
					tipFun('请输入新密码');
					return;
				}
				if(!notEmpty(pwd2)){
					tipFun('请输入确认密码');
					return;
				}
				if(pwd1!=pwd2){
					tipFun('两次密码不一致');
					return;
				}

				$.ajax({
						type: "post",
						dataType: "json",
						url: "__URL__/password2",
						data: {login_pass:$('#login_pass').val(),repassword:$('#repassword').val()},
						success: function(json){
							tipFun(json.info);
							if(json.status>0)
							{
								setTimeout(function(){
									window.location.href='/Member/Login';
								},1000);
							}
						}
					})
				});
		</script>
	</body>
</html>
